# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python-wayback
_pkgname=wayback
pkgver=0.4.5
pkgrel=3
pkgdesc='Python API to Internet Archive Wayback Machine'
url='https://pypi.org/project/wayback/#files'
arch=('any')
license=('BSD')
depends=('python' 'python-requests' 'python-urllib3')
makedepends=('python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz"
        'setup.py.patch')
sha512sums=('2925472dad8b3e9cb0889ff52b88576c302d2afdea1a9e2d6a0bf5263fa74cf1721baf5853f2dc73243ae672b1bd855a1a55d5bfb6920afb027c66110de00945'
            '21a1e08164be6538a3876cf0213e7cfa894628365541e8e041e5bc45aa7d7667b644890d91b56c8ad88c00363750b404d3ad1f42afae098227516f5d96d82179')

prepare() {
  cd "$_pkgname-$pkgver"

  patch -p0 < ../setup.py.patch
}

build() {
  cd "$_pkgname-$pkgver"

  python setup.py build
}

package() {
  cd "$_pkgname-$pkgver"

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

